//local modelDefined = false

if (SERVER) then
	AddCSLuaFile( "shared.lua" )
end

if (CLIENT) then
	SWEP.PrintName			= "Pistol"
	SWEP.Author				= "PirateShip Wars GM9 / Metroid48"
//	SWEP.Contact			= "metroid48@gmail.com"
//	SWEP.Instructions		= "Aim at enemy."
	SWEP.Slot				= 1
	SWEP.SlotPos			= 1
	SWEP.IconLetter			= "c"
	
	killicon.Add("weapon_ppistol", "gmod/SWEP/pistol_select", Color(255,255,255,255))
end

SWEP.Base					= "weapon_cs_base"

SWEP.HoldType				= "pistol" //maybe server-only

SWEP.ViewModel				= "models/pistol_a/v_pistol_a.mdl"
SWEP.WorldModel				= "models/pistol_a/w_pistol_a.mdl"

SWEP.Weight				= 5
SWEP.AutoSwitchTo			= false
SWEP.AutoSwitchFrom			= true
SWEP.Spawnable				= true

SWEP.Primary.Sound			= Sound("Weapon_shotgun.single")
SWEP.Primary.Recoil			= 0.5
SWEP.Primary.Damage			= 90
SWEP.Primary.NumShots			= 1
SWEP.Primary.Cone			= 0.05
SWEP.Primary.ClipSize			= 1
SWEP.Primary.Delay			= 0.3
SWEP.Primary.DefaultClip		= 2
SWEP.Primary.Automatic			= false
SWEP.Primary.Ammo			= "pistol"

SWEP.Secondary.ClipSize			= -1
SWEP.Secondary.DefaultClip		= 2
SWEP.Secondary.Automatic		= false
SWEP.Secondary.Ammo			= "none"

function SWEP:Deploy()
		if self.Owner:Team() == TEAM_BLUE then
			self.Owner:GetViewModel():SetModel("models/pistol_a/v_pistol_a.mdl")
		else
			self.Owner:GetViewModel():SetModel("models/pistol_a/v_pistol_b.mdl")
		end
	return true
end
